﻿using UnityEngine;
using System.Collections;
using UnityEngine.Networking;

public class Attribute : NetworkBehaviour {
	public float maxHealth = 1000f;
	//[SyncVar(hook = "OnChangeHealth")]
	[SyncVar]
	public float health = 1000f;

	public float attack = 50f;
	// Use this for initialization
	void Start () {
		//health = maxHealth;
	}
	
	// Update is called once per frame
	void Update () {

	}
	void OnChangeHealth(float health){
		SendMessage ("OnHealthChanged");
	}
	public void changeHealth(float h){
		health += h;
		SendMessage ("OnHealthChanged");
	}
	public void changeAttack(float a){
		attack += a;
	}
}
